<template>
  <div>
    <van-nav-bar
      :z-index="999"
      :fixed="true"
      left-arrow
      @click-left="onClickLeft"
      :placeholder="true"
      title="驾考秘籍"
    ></van-nav-bar>

    <!-- 驾考秘籍 -->
    <div class="esoterica_background">
      <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
        <div
          class="esoterica"
          v-for="(item, index) in lists"
          :key="index"
          @click="href('/SecretDetails', item.id)"
        >
          <img :src="item.picurl" alt />
          <div class="esoterica-list">
            <p>{{ item.title }}</p>
            <div class="esoterica-item">
              <div>
                <img src="../../assets/images/18.png" alt />
                <p>{{ item.djl }}</p>
              </div>
              <div>
                <img src="../../assets/images/16.png" alt />
                <p>{{ item.collect }}</p>
              </div>
              <div>
                <img src="../../assets/images/60.png" alt />
                <p>{{ item.message }}</p>
              </div>
            </div>
          </div>
        </div>
      </van-pull-refresh>
    </div>
  </div>
</template>

<script>
import { CardLists } from "../../assets/js/api/exam";
// import { baseURL } from "../../assets/js/config";
export default {
  name: "Esoterica",
  data() {
    return {
      isLoading: false,
      // 假数据
      lists: [
        // {
        //   img: require("../../assets/images/08.png"),
        //   title: "题库更新题新！驾校一点通贷车、客车科目四全国题更更新196题",
        //   reads: "2.4W",
        //   collect: "25",
        //   message: "3"
        // },
      ]
    };
  },

  mounted() {
    // this.baseURL = baseURL;
    // console.log(this.$route.params.type);
    CardLists(this.$route.params.type).then(res => {
      console.log(res);
      this.lists = res.data;
    });
  },

  methods: {
    href(url, lid) {
      this.$router.push({ path: `${url}/${lid}` });
    },
    onClickLeft() {
      this.$router.go(-1);
    },
    onRefresh() {
      setTimeout(() => {
        this.isLoading = false;
        this.count++;
      }, 1000);
    }
  },
  created() {
    let dsBridge = require("dsbridge");
    dsBridge.call("goBack", "", function() {
      history.go(-1);
    });
  }
};
</script>

<style></style>
